package com.ruoyi.project.good.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.good.mapper.GoodsKillMapper;
import com.ruoyi.project.good.domain.GoodsKill;
import com.ruoyi.project.good.service.IGoodsKillService;

/**
 * 商品秒杀Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-07-01
 */
@Service
public class GoodsKillServiceImpl implements IGoodsKillService 
{
    @Autowired
    private GoodsKillMapper goodsKillMapper;

    /**
     * 查询商品秒杀
     * 
     * @param killId 商品秒杀ID
     * @return 商品秒杀
     */
    @Override
    public GoodsKill selectGoodsKillById(Long killId)
    {
        return goodsKillMapper.selectGoodsKillById(killId);
    }

    /**
     * 查询商品秒杀列表
     * 
     * @param goodsKill 商品秒杀
     * @return 商品秒杀
     */
    @Override
    public List<GoodsKill> selectGoodsKillList(GoodsKill goodsKill)
    {
        return goodsKillMapper.selectGoodsKillList(goodsKill);
    }

    /**
     * 新增商品秒杀
     * 
     * @param goodsKill 商品秒杀
     * @return 结果
     */
    @Override
    public int insertGoodsKill(GoodsKill goodsKill)
    {
        goodsKill.setCreateTime(DateUtils.getNowDate());
        return goodsKillMapper.insertGoodsKill(goodsKill);
    }

    /**
     * 修改商品秒杀
     * 
     * @param goodsKill 商品秒杀
     * @return 结果
     */
    @Override
    public int updateGoodsKill(GoodsKill goodsKill)
    {
        return goodsKillMapper.updateGoodsKill(goodsKill);
    }

    /**
     * 批量删除商品秒杀
     * 
     * @param killIds 需要删除的商品秒杀ID
     * @return 结果
     */
    @Override
    public int deleteGoodsKillByIds(Long[] killIds)
    {
        return goodsKillMapper.deleteGoodsKillByIds(killIds);
    }

    /**
     * 删除商品秒杀信息
     * 
     * @param killId 商品秒杀ID
     * @return 结果
     */
    @Override
    public int deleteGoodsKillById(Long killId)
    {
        return goodsKillMapper.deleteGoodsKillById(killId);
    }
}
